import request from '@/utils/request'

/**
 * 查询交接班列表信息
 * @param {*} query 
 * @returns 
 */
export function getHandOverList(query) {
  return request({
    url: '/duty/schedule/selectScheduleListByUser',
    method: 'get',
    params: query,
  })
}

/**
 * 新增交接班信息
 * @param {*} data 
 * @returns 
 */
export function addHandOver(data) {
  return request({
    url: '/duty/handover',
    method: 'post',
    data: data
  })
}

/**
 * 开始值班
 * @param {*} data 
 * @returns 
 */
export function beginDuty(data) {
  return request({
    url: '/duty/schedule/beginDuty',
    method: 'put',
    data: data
  })
}

/**
 * 获取接班用户列表
 * @param {*} query 
 * @returns 
 */
export function getNextDutyUsers() {
  return request({
    url: '/duty/schedule/nextDutyUsers',
    method: 'get',
  })
}

/**
 * 获取接班信息列表
 * @param {*} query 
 * @returns 
 */
export function getTakeOverList(query) {
  return request({
    url: '/duty/handover/list',
    method: 'get',
    params: query,
  })
}

/**
 * 获取交接班详情
 * @param {*} handoverId 
 * @returns 
 */
export function getHandOverInfo(handoverId) {
  return request({
    url: '/duty/handover/' + handoverId,
    method: 'get',
  })
}

/**
 * 确认交接班
 * @param {*} handoverId 
 * @returns 
 */
export function checkHandover(handoverId) {
  return request({
    url: '/duty/handover/check/' + handoverId,
    method: 'put'
  })
}
